<template>
  <div class="dashboard-container">
    <div class="dashboard-text">name: {{ adminName }}</div>
  </div>
</template>

<script>
import store from '@/store'
import utils from '@/utils/checkLogin'
import { mapGetters } from 'vuex'

export default {
  name: 'Dashboard',
  computed: {
    ...mapGetters([
      'name'
    ])
  },
  data() {
    return {
      adminName: store.state.user.name
    }
  },
  methods: {
  },
  created() {
    utils.checkLogin()
    // location.reload()
  },
  mounted: function () {
    console.log(this.$store.state.user.name);
    // if (location.href.indexOf("#/dashboard") == -1) {
    //   location.href = location.href + "#reloaded";
    //   location.reload();
    // }
  }
}
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }

  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
</style>
